HTTP Request Library Object
The HTTP Request functions enable you to invoke Web service requests.
For an example of working with these functions, see Using the HTTP Request Functions.
The business entities in this library are exposed under Business Entities > Library Types > Communication> HTTP Request.
The functions are exposed under Project > References > Library References > Direct.Common > HTTP Request.
Before you use these functions, create an instance of the HTTP Request business entity. Enter the values in the required parameters to invoke the web service request.
Name |
input type |
description |
---|---|---|
Accept | Text | Specify the media types that are acceptable for the response. |
Authentication Type |
Text |
The authentication mechanism supported by the Web service. The supported authentication types are:
|
Auto Redirect |
Boolean | Indicates if automatic redirection of the Web request is enabled or disabled. |
Content Type |
Text | The content type for the Web request. |
Inbound Encoding |
Text | The encoding type for an incoming response. |
Method | Text | The Request method for the Web service request. The supported values are: Post, Get, Put, and Delete. |
Outgoing Encoding |
Text | The encoding type for an outgoing request. |
Protocol Version |
Text |
The HTTP Protocol version to use for the HTTP request. The supported values are 1.0 (default value) and 1.1. For any other values in this field, RT Client uses default value (1.0) for an HTTP Request. Note: Requires that 7.4_RTClient_RTDesigner_HF_Pack_7.4.3.31 or higher be installed. |
Password |
Text | The password to connect to the Web server. |
Proxy Port |
Number | The port of the proxy server. |
Proxy Server |
Text | The URL of the proxy server. |
Request Body |
Text |
The body of the Web service request. |
Response |
Text |
The Response to the Web service request. If the response is saved as a file, this property is set to Response saved as a file <full path>. |
Response Headers |
List of Key-Value pair |
The HTTP response header. |
Status | Text | Indicates the status of the Web service request. |
Timeout |
Number |
The Web server connection timeout time. |
URL |
Text |
The URL of the Web server. |
User Agent |
Text |
A user agent string containing properties of the Request user's system. |
User Name |
Text |
The username to connect to the Web server. |
Windows Authentication |
Boolean |
Indicates if the use of Windows authentication to connect to the Web server in enabled or disabled. |
The events of HTTP Request library are listed below:
Events | Description |
---|---|
Async Callback | This event is raised when the execution of Post Request Asynchronously is completed. |
Exception | This event is raised when an HTTP request gets an exception, after the request is sent to the server. |
The functions of HTTP Request library are listed below:

Adds a specified header with a specified value, to the HTTP Request.
HTTP headers enable the client and the server to pass additional information with the request or the response. Common HTTP response headers include Accept, Connection, and Date.
Parameter | Input | Description |
---|---|---|
Header |
Text |
The Header to add to the Web service request. |
Value |
Text |
The Header value. |
Returns
Does not return any value.

Aborts the asynchronous request. This can be used to abort the request that is taking a long time to process.
Parameter | Input | Description |
---|---|---|
Request ID |
Text |
ID of the Web service request. |
Returns
Does not return any value.

Returns the value of the specified header of a response.
Parameter | Input | Description |
---|---|---|
Header |
Text |
The header from which you want the response value. |
Returns
Returns the response value of the specified header as text.

Posts the HTTP request to the Web server. The response is received as text. If expecting a response that is not plain text, for example, a binary file, use Post Request and Save Response as File instead.
This function does not use any parameters.
Returns
Returns True if the request was sent successfully, else returns False.

Posts the HTTP request to the Web server. The response is saved in the specified file. This method should be used instead of Post Request when expecting a response that is not plain text, for example, a binary file.
Parameter | Input | Description |
---|---|---|
Full Path | Text |
The full path to the file in which to save the response. Example: C:\temp\response.txt |
Returns
Returns True if the request was sent successfully, else returns False.

Posts the HTTP request to the Web server together with a specified file. Use this method to send the file in a request using form-data structure.
Parameter | Input | Description |
---|---|---|
Key Name |
Text |
The name of the key to which the file must be attached. |
File Path | Text |
The full path to the file to upload. Example: C:\temp\request.txt |
Returns
Returns True if the request was sent successfully, else returns False.

Posts the HTTP request to the Web server together with a specified file. Use this method to send the contents of a file as binary data in the request body.
Parameter | Input | Description |
---|---|---|
File Path | Text |
The full path to the file to upload as binary body data, for example, C:\temp\request.txt |
Returns
Returns True if the request was sent successfully, else returns False.

Posts the HTTP request to the Web server asynchronously. This function does not use any parameters.
Since APA 7.3, the syntax of this function has been changed. For an existing solution that uses this function, you must re-compile and re-publish the solution to the relevant user groups, even if there is no change in the solution logic, to avoid run time exception.
Returns
Returns the Request ID as text.

Removes all the headers and header values from the HTTP request.
Returns
Returns True if all the headers were successfully removed, else returns False.

Removes a header from the HTTP request.
Parameter | Input | Description |
---|---|---|
Header |
Text |
The name of the header to remove from the HTTP request. |
Returns
Does not return any value.

Retrieves all the headers and the header values from the HTTP request. This function does not use any parameters.
Returns
Returns all headers and header values as a List of Text.

Specifies the path of the certificate to send with the HTTP request for authentication, along with the password for the certificate.
Parameter | Input | Description |
---|---|---|
Path |
Text |
Path of the certificate. |
Password |
Text |
Password for the certificate. |
Returns
Does not return any value.

Specifies the path of the certificate to send with the HTTP request for authentication. The password is fetched automatically from the local machine certificate store.
Parameter | Input | Description |
---|---|---|
Path |
Text |
Path of the certificate. |
Returns
Does not return any value.

Updates the header value in a header of the HTTP request.
Parameter | Input | Description |
---|---|---|
New Value |
Text |
The new value to add to the header. |
Header |
Text |
The name of the header to which to add the new value. |
Returns
Returns True if the header value is updated, else returns False.